home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_05
/
9n05102a
< prev
next >
Wrap
Text File
|
1991-03-24
|
1KB
|
44 lines
// Defines for all functions in this article.
#define PI 3.141592654
#define TWOPI (2*PI)
#define RTD (180/PI)
#define DTR (PI/180)
// All code was written in MSC 5.1 under PC-DOS.
// Units used: km for position, km/s for vel
// angle (i,lan,w,M,E,nu) units: deg
// Value of earth mu used: 398600.8 km**3/s**2
// FUNCTION k2ce()
// This routine converts classical Keplerian elements to
// Cartesian position and velocity.
// Input : k[6] -- a, e, i, lan, w, m
// mu -- mu of central body ;
// Output: c[6] -- x, y, z, xdot, ydot, zdot
k2c (double *k, double mu, double *c)
SAMPLE INPUT/OUTPUT
A 7378.14 E 0.10 I 30.00 X 6640.32 Y 0.00 Z 0.00
LAN 0.00 W 0.00 M 0.00 XD 0.00 YD 7.03 ZD 4.06
// FUNCTION c2ke()
// This routine converts Cartesian position and velocity
// to classical Keplerian elements, for elliptical
// orbits.
// Input : c[6] -- pos/vel;
// mu -- mu of central body
// Output: k[6] -- a,e,i,lan,w,m
// ** i,lan,w,M are output in degrees **
SAMPLE INPUT/OUTPUT
Outputs from k2ce() were input; the output reproduced
the k2ce() input.